<?php
namespace app\common\validate;

use think\Validate;

class Need extends Validate
{
    protected $rule = [
       'type' => 'require|in:1,2',
       'title' => 'require|max:100',
       'end_time' => 'require|dateFormat:Y-m-d H:i',
       'budget' => 'number',
       'pay_price' => 'number',
       'lng' => 'require',
       'lat' => 'require',
       'city' => 'require',
       'address' => 'require',
       'hint' => 'in:0,1',
    ];
    protected $message = [
       'type.require' => '请选择需求类型',
       'type.in' => '需求类型错误',
       'title.require' => '请输入需求内容',
       'title.max' => '需求内容不得超过100个字符',
       'end_time.require' => '请选择截止时间',
       'end_time.dateFormat' => '截止时间格式有误',
       
       'budget.number' => '请输入有效的金额',
       'pay_price.number' => '请输入有效的金额',
       'lng.require' => '参数lng丢失',
       'lat.require' => '参数lat丢失',
       'city.require' => '请上传城市编码',
       'address.require' => '请选择发布地点',
       'hint.in' => '抢单提示有误',
    ];
    protected $scene = [
       
    ];
}
